#include <stdio.h>
#include <stdlib.h>
#include "crc.h"

uint8_t pain_data[] = {0x1f, 0x01, 0x34, 0x56, 0x58, 0x98, 0x90, 0x00, 0x32};

int main()
{
    for (size_t i = 0; i < 257; i++)
    {
        printf("round: %d, input[0] = 0x%02X:", i, ++(*pain_data));
        uint8_t crc = crc4_itu(pain_data, sizeof(pain_data));
        printf("crc4_itu: 0x%02X ", crc);

        uint8_t crc2 = crc4_itu_lk(pain_data, sizeof(pain_data));
        printf("crc4_itu_lk: 0x%02X\n", crc2);

        if(crc != crc2)
        {
            printf("something wrong!!!\r\n");
            exit(0);
        }
    }
    return 0;
}
